package jpa.startup;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import jpa.entities.User;
import jpa.entities.UserGroup;
import jpa.session.UserFacadeRemote;

@Singleton
@Startup
public class StartupBean {
    @EJB
    private UserFacadeRemote userFacade;

    @PostConstruct
    public void startup() {

        if (userFacade.count() == 0) {

            userFacade.createTestUsers();
        }

    }
}
